<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/6/19
  Time: 18:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>新建跟踪</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css">
</head>
<body>
<form class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">客户名称</label>
            <div class="layui-input-inline">
                <select name="customerId"  lay-search="">
                    <option value="">请选择</option>
                    <c:forEach var="cus" items="${customerList}">
                        <option value="${cus.id}">${cus.name}</option>
                    </c:forEach>
                </select>
            </div>
        </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">时间</label>
            <div class="layui-input-inline">
                <input type="date" class="layui-input" id="test1" placeholder="yyyy-MM-dd">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">地点</label>
        <div class="layui-input-inline">
            <input type="System.currentTimeMillis()" name="address" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">结果</label>
        <div class="layui-input-inline">
            <input type="text" name="result" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">概要</label>
        <div class="layui-input-block">
            <textarea name="general" placeholder="" class="layui-textarea"></textarea>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">详细信息</label>
        <div class="layui-input-block">
            <textarea name="content" placeholder="" class="layui-textarea"></textarea>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <textarea name="remark" placeholder="" class="layui-textarea"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">选择文件</label>
        <div class="layui-input-inline">
            <input type="file" name="decoument">
        </div>
    </div>
    <div class="layui-form-item">
        <button style="margin-left: 100px"lay-filter="add" lay-submit class="layui-btn" >保存</button>
    </div>
</form>
<script src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
<script>
    //layui引入特定模块的方式
    layui.use(['layer', 'form','jquery'], function () {
        var layer = layui.layer//layer 弹窗对象
            , form = layui.form;//表单对象
        var $ = layui.$;

        form.on("submit(add)",function (data) {
            $.post("${pageContext.request.contextPath}/follow/tracks",data.field,function (result) {
                if (result.code==0){
                    layer.msg("修改成功!");
                    //刷新父窗口内容
                    parent.layui.table.reload("roleTable", {
                            page:{
                                curr:1
                            }
                        }
                    )
                    //关闭弹窗
                    var index=parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                }
            },"json")
            return false;//阻止默认表单提交
        })
    });
</script>
</body>
</html>
